#include"Job.h"
#include<fstream>
#include<iostream>
#include<ctime>
#include<vector>
#include<random>
using namespace std;


int main()
{
    // ofstream of(PATH,std::ios::binary|std::ios::out);
    ifstream in(PATH,std::ios::binary|std::ios::in);
    Job vjob;
    // std::srand(static_cast<unsigned>(std::time(0)));
    // for(int i = 0;i<100;i++)
    // {
    //     vjob.process_id = time(nullptr)+i;
    //     vjob.arrival_time = i;
    //     vjob.wait_time = 0;
    //     vjob.burst_time = rand()%10;
    //     vjob.remaining_time = vjob.burst_time;
    //     vjob.radio = 1.0;
    //     of.write((char*)&vjob,sizeof(vjob));
    // }

    cout << "=====================================" << endl;
    while(in.read((char*)&vjob,sizeof(Job)))
    {
        cout << "====================================="<<endl;
        cout << "arrival: "<<vjob.arrival_time<<endl;
        cout <<"wait time: " << vjob.wait_time<<endl;
        cout << "process_id: " << vjob.process_id <<endl;
        cout << "burst_time: " <<vjob.burst_time <<endl;
        cout << "reaming_time: " <<vjob.remaining_time<<endl;
        cout << "radio: " << vjob.radio <<endl;
        cout << "====================================="<<endl;
    } 


    return 0;
}